package se3a04.mcmapster;

import java.util.ArrayList;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class currentHunt extends ListActivity{
	
	static ArrayList<clue> clues = new ArrayList<clue>();
	ArrayList<String> clueName = new ArrayList<String>();
	static int clueIndex;
	
	@Override
	protected void onCreate(Bundle currentHuntState) {
		
		populateCurrentHunt();
		super.onCreate(currentHuntState);
		setListAdapter(new ArrayAdapter<String>(currentHunt.this, android.R.layout.simple_list_item_1, clueName));
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		
		clueIndex = position;
		super.onListItemClick(l, v, position, id);
		Intent displayClueInfo = new Intent("se3a04.mcmapster.DISPLAYCLUEINFO");
		startActivity(displayClueInfo);
		
	}
	
	public void populateCurrentHunt() {
		
		String huntClues = "1:2:3;4:5:6;7:8:9;";
		//String huntClues = LocalDB.getClues(chooseHunt.chosenHunt);
		String[] tempClues = huntClues.split(";");
		
		for(String t : tempClues) {
			
			String[] tempClue = t.split(":");
			clue temp = new clue();
			temp.clueName = tempClue[0];
			temp.clueRiddle = tempClue[1];
			temp.clueAnswer = tempClue[2];
			clueName.add(tempClue[0]);
			clues.add(temp);
		}
	}
}

class clue {

	String clueName;
	String clueRiddle;
	String clueAnswer;
}